<?php


namespace Module\Demo\Api\Controller;


use Illuminate\Routing\Controller;
use ModStart\Core\Dao\ModelUtil;
use ModStart\Core\Input\Response;

/**
 * Class NewsCategoryController
 * @package Module\Demo\Api\Controller
 *
 * @Api 新闻分类
 */
class NewsCategoryController extends Controller
{
    /**
     * @return array
     *
     * @Api 获取所有新闻分类
     * @ApiResponseData [
     *      {"id":1,"title":"分类1"},
     *      {"id":2,"title":"分类2"}
     * ]
     */
    public function all()
    {
        return Response::generateSuccessData(ModelUtil::all('demo_news_category'));
    }
}
